

var  PAGE  = {
	
	//  实例化表格
	init_table:function(t_w){
		layui.use(function(){
		    var table = layui.table;
		    var laydate = layui.laydate;
		    // 日期范围 - 左右面板联动选择模式
		    laydate.render({
		      elem: '#ID-laydate-rangeLinked',
		      range: ['#ID-laydate-start-date-1', '#ID-laydate-end-date-1'],
		      rangeLinked: true // 开启日期范围选择时的区间联动标注模式 ---  2.8+ 新增
		    });
		  
			  // 已知数据渲染
			var inst = table.render({
				with:t_w,
				even: true,
				page: false, 
				limits: false,
				limit: 13, // 每页默认显示的数量
				elem: '#ID-table-demo-data',
				skin:"nob",
				cols: [[ //标题栏
				  {field: 'id', title: '序号', minWidth: 40,type:'numbers',},
				  {field: 'a1', title: '名称', minWidth: 130,},
				  {field: 'a2', title: '分类', minWidth: 90},
				  {field: 'a3', title: '作者', minWidth: 90},
				  {field: 'a4', title: '上传日期', minWidth: 120},
				  {field: 'a5', title: '定价', minWidth: 80, },
				  {field: 'a6', title: '下载次数', minWidth: 100, },
				  {fixed: 'right', title:'操作', minWidth: 100, toolbar: '#barDemo',align:"center"}
				]],
				
				data: [
					{"id": "1","a1": "_使用STM32设计HMI硬件","a2": "分类","a3": "章三","a4": "2024-02-12","a5":"￥12000.00","a6":"10万+",},
					{"id": "1","a1": "_使用STM32设计HMI硬件","a2": "分类","a3": "章三","a4": "2024-02-12","a5":"￥12000.00","a6":"10万+",},
					{"id": "1","a1": "_使用STM32设计HMI硬件","a2": "分类","a3": "章三","a4": "2024-02-12","a5":"￥12000.00","a6":"10万+",},
					{"id": "1","a1": "_使用STM32设计HMI硬件","a2": "分类","a3": "章三","a4": "2024-02-12","a5":"￥12000.00","a6":"10万+",},
					{"id": "1","a1": "_使用STM32设计HMI硬件","a2": "分类","a3": "章三","a4": "2024-02-12","a5":"￥12000.00","a6":"10万+",},
					{"id": "1","a1": "_使用STM32设计HMI硬件","a2": "分类","a3": "章三","a4": "2024-02-12","a5":"￥12000.00","a6":"10万+",},
				],
				
			});
			  
			// 已知数据渲染
			var inst2 = table.render({
				width:t_w,  
				even: true,
				page: false, 
				limits: false,
				limit: 13, // 每页默认显示的数量
				  elem: '#ID-table-demo-data2',
				skin:"nob",
				  cols: [[ //标题栏
					{field: 'id', title: '序号', minWidth: 40,type:'numbers',},
					{field: 'a1', title: '名称', minWidth: 130,},
					{field: 'a2', title: '分类', minWidth: 90},
					{field: 'a3', title: '作者', minWidth: 90},
					{field: 'a4', title: '上传日期', minWidth: 120},
					{field: 'a5', title: '定价', minWidth: 80, },
					{field: 'a6', title: '下载次数', minWidth: 100, },
					{fixed: 'right', title:'操作', minWidth: 100, toolbar: '#barDemo2',align:"center"}
				  ]],
				
				  data: [
					{"id": "1","a1": "_使用STM32设计HMI硬件","a2": "分类","a3": "章三","a4": "2024-02-12","a5":"￥12000.00","a6":"10万+",},
					{"id": "1","a1": "_使用STM32设计HMI硬件","a2": "分类","a3": "章三","a4": "2024-02-12","a5":"￥12000.00","a6":"10万+",},
					{"id": "1","a1": "_使用STM32设计HMI硬件","a2": "分类","a3": "章三","a4": "2024-02-12","a5":"￥12000.00","a6":"10万+",},
					{"id": "1","a1": "_使用STM32设计HMI硬件","a2": "分类","a3": "章三","a4": "2024-02-12","a5":"￥12000.00","a6":"10万+",},
					{"id": "1","a1": "_使用STM32设计HMI硬件","a2": "分类","a3": "章三","a4": "2024-02-12","a5":"￥12000.00","a6":"10万+",},
					{"id": "1","a1": "_使用STM32设计HMI硬件","a2": "分类","a3": "章三","a4": "2024-02-12","a5":"￥12000.00","a6":"10万+",},
				],
				  
			});
		  
		  
		  
		});
	},
	
	// 分页功能
	wxx_pages:function(){
		layui.use(function(){
		  var laypage = layui.laypage;
		  // 完整显示
		  laypage.render({
		    elem: 'demo-laypage-all', // 元素 id
		    count: 100, // 数据总数
		    layout: [ 'prev', 'page', 'next','skip','count',  ], // 功能布局
			prev: '<em>←</em>',
			next: '<em>→</em>',
		    jump: function(obj){
		      
		    }
		  });
		});
		
	},
	
}


var t_w = $('.matDtas').innerWidth()
if(t_w){
	PAGE.init_table(t_w)
	PAGE.wxx_pages();
}
